Back to course home
0% completed
Vote For New Content
Microsoft Hard Problems
Regular Expression Matching (hard)
Solution: Regular Expression Matching
First Missing Positive (hard)
Solution: First Missing Positive
Largest Rectangle in Histogram (hard)
Solution: Largest Rectangle in Histogram
Sliding Window Maximum (hard)
Solution: Sliding Window Maximum
Count Unique Characters of All Substrings of a Given String (hard)
Solution: Count Unique Characters of All Substrings of a Given String
Word Ladder (hard)
Solution: Word Ladder
Word Ladder II (hard)
Solution: Word Ladder II
Number of Flowers in Full Bloom (hard)
Solution: Number of Flowers in Full Bloom
Median of Two Sorted Arrays (hard)
Solution: Median of Two Sorted Arrays
Longest Valid Parentheses (hard)
Solution: Longest Valid Parentheses
Maximum Length of a Concatenated String with Unique Characters (medium)
Problem Statement
Given an array arr containing strings, return the maximum length of the string that can be formed by the concatenations of the subsequence of arr, having unique characters.
A subsequence is an array that can be formed from arr by deleting 0 or more elements without changing the order of the remaining elements.
Examples
-
Example 1:
- Input: ["ab", "cd", "e"]
- Expected Output: 5
- Justification: Concatenating "ab", "cd", and "e" forms "abcde" which has all unique characters and is of maximum length 5.
-
Example 2:
- Input: ["a", "abc", "d", "de", "def"]
- xpected Output: 6
- Justification: Concatenating "abc", and "def" forms "abcdef" which has all unique characters and is of maximum length 6.
-
Example 3:
- Input: ["xyz", "y", "z"]
- Expected Output: 3
- Justification: We can choose only "xyz" string. Hence, the maximum length is 3.
Try it yourself
Try solving this question here:
Java
Saved to Cloud
. . . .
Solution: Score of Parentheses
Solution: Maximum Length of a Concatenated String with Unique Characters
Mark as Completed
On this page
Problem Statement
Examples
Try it yourself